<%-- 
    Document   : articlesList
    Created on : May 17, 2012, 12:46:11 PM
    Author     : ciummo
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<script type="text/javascript" src="/DGestWebServer/SCRIPT/jquery-1.6.2.js"></script>
<script type="text/javascript" src="/DGestWebServer/SCRIPT/Ajax.js"></script>

<script type="text/javascript">
    function eraseArticle(codArticolo,nome){
        if(window.confirm("Sei sicuro di voler eliminare l'articolo "+nome+" ("+ codArticolo+")?")){
            window.location="Article.do?method=eraseArticle&codArticolo="+codArticolo;
        }
    }
</script>


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="/DGestWebServer/css/dgest.css"/>
        <title>Gestione Articoli</title>
    </head>
    <body>
        
        <%@ include file="../adminDialogBar.jspf" %>
        
        <div id="subMenu">
            <html:link page="/Article.do?method=newArticle"> <img src="/DGestWebServer/images/articleAdd.png" alt="Add Order" height="125px" width="125px"/> </html:link>

        </div>
            
        <br>
        <h1> Gestisci Articoli </h1>
        <br>    
            
            
        
        <table class="objectList">
            
            <caption class="tabs"><ul class="tabs">

                    
                    <logic:equal name="view" value="all"><li class="active"></logic:equal> 
                    <logic:notEqual name="view" value="all"><li class="tabs"></logic:notEqual>    
                    
                        <html:link page="/Article.do?method=listArticles&func=all"> Visualizza tutti </html:link>
                    </li>
                    
                    <logic:equal name="view" value="Comunicatore"><li class="active"></logic:equal> 
                    <logic:notEqual name="view" value="Comunicatore"><li class="tabs"></logic:notEqual>    
                    
                        <html:link page="/Article.do?method=listArticles&func=Comunicatore"> Visualizza comunicatori </html:link>
                    </li>
                    
                    <logic:equal name="view" value="Supporto"><li class="active"></logic:equal> 
                    <logic:notEqual name="view" value="Supporto"><li class="tabs"></logic:notEqual>
                        
                        <html:link page="/Article.do?method=listArticles&func=Supporto"> Visualizza Supporti </html:link>
                    </li>
             </ul></caption>
            
            <thead>
                <tr>                                
                    <th>Codice</th>
                    <th>Nome</th>
                    <th>Tipo</th>
                    <th>Prezzo</th>
                    <th>Note</th>
                    <th></th>
                </tr>
            </thead>

            <tbody>

                <logic:iterate id="article" name="ArticleActionForm" property="list" indexId="index" >
                    <pg:item>
                        <tr>

                            <th><bean:write name="article" property="codArticolo"/></th>
                            <td><bean:write name="article" property="nome"/></td>
                            <td><bean:write name="article" property="tipo"/></td>
                            <td><bean:write name="article" property="prezzo"/></td>
                            <td><bean:write name="article" property="note"/></td>
                            <td>
                            
                            <a href="#" onclick="eraseArticle('<bean:write name="article" property="codArticolo"></bean:write>','<bean:write name="article" property="nome"></bean:write>')"><img src="/DGestWebServer/images/erase.png" alt="Elimina Articolo" height="25px" width="25px"/></a>
                                
                            <html:link page="/Article.do?method=editArticle" paramId="codArticolo" paramName="article" paramProperty="codArticolo"><img src="/DGestWebServer/images/modify.png" alt="Modifica Articolo" height="25px" width="25px"/></html:link>

                            </td>


                        </tr>
                    </pg:item>
                </logic:iterate>

            </tbody>
        </table>

            <%@ include file="../footBar.jspf" %>
    </body>
</html>
